package com.dddd.blogswagger.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 喵星球的大橘
 */
@RestController
@RequestMapping("/user")
@Api(value = "用户测试接口", tags = {"用户测试接口"}, description = "用户测试接口")
public class UserController {

    @PostMapping("/find")
    @ApiOperation(value = "响应用户", notes = "响应用户")
    public String test(@ApiParam(name = "name") String name,
                       @ApiParam(name = "age", defaultValue = "18")int age)
    {
        return name + age;
    }


    /**
     * @param id
     * @return
     */
    @PostMapping("/find/{id}")
    @ApiOperation(value = "查找用户", notes = "查找用户" )
    public String findUserById(@PathVariable String id){
        return "用户id"+id;
    }

}
